package com.gtxc.kotlinmvvm.utlis;

import android.text.SpannableString;
import android.text.Spanned;

import com.zhixinhuixue.zsyte.xxx.app.util.BottonAlignSpan;
import com.zhixinhuixue.zsyte.xxx.app.util.TopAlignSpan;

/**
 * FileName:TextviewUtlis
 * Author：Administrator
 * Date:2021 2021/9/23 11:20
 * Copyright (C), 2020-2021,成都拇音科技有限公司
 * <p>
 * <p>
 * Description: 张万里
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
public class TextviewUtlis {
    public static SpannableString changTVsize(String value) {
        SpannableString spannableString = new SpannableString(value);
        if (value.contains(".")) {
            spannableString.setSpan(new TopAlignSpan(15f), value.indexOf(".")+1, value.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            spannableString.setSpan(new BottonAlignSpan(15f), value.length()-1, value.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        }
        return spannableString;
    }

}
